package cn.hls.service.impl;

import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import cn.hls.dao.CarCategoryDao;
import cn.hls.entity.CarCategory;
import cn.hls.entity.vo.PageInfo;
import cn.hls.service.CarCategoryService;

/**
 * @fileName: CarCategoryServiceBean.java
 * @package: cn.christ.service.impl
 * @Description: 场地业务逻辑接口实现类
 * @author: yinghui.zhang
 * @email: uuhui@163.com
 * @date: 2015-8-9
 */
@Service("carCategoryService")
public class CarCategoryServiceBean extends BaseServiceBean<CarCategory> implements
		CarCategoryService {
	@Resource(name = "carCategoryDao")
	private CarCategoryDao dao;

 	 
	@Override
	public PageInfo<CarCategory> loadCarCategoryInfo(PageInfo<CarCategory> page,
			CarCategory entity) throws Exception {
		return dao.loadCarCategoryInfo(page, entity);
	}

	@Override
	public CarCategory loadCarCategoryByName( String name)
			throws Exception {
		return dao.loadCarCategoryByName( name);
	}
@Override
public boolean update(CarCategory entity) throws Exception {
	CarCategory tempEntity =dao.find(entity.getId());
	BeanUtils.copyProperties(entity, tempEntity);
	tempEntity.setUpdateTime(new Date());
	return super.update(tempEntity);
}

@Override
public List<CarCategory> loadCarCategoryInfo(CarCategory entity) throws Exception {
	return dao.loadCarCategoryInfo( entity);
}
}
